Skip to content

fix: polish Altimate connect dialog — default URL, rename labels, fix placeholder#724

Merged
anandgupta42 merged 6 commits intomainfrom
fix/altimate-connect-dialog-polish
Apr 21, 2026
Merged

fix: polish Altimate connect dialog — default URL, rename labels, fix placeholder#724
anandgupta42 merged 6 commits intomainfrom
fix/altimate-connect-dialog-polish

Conversation

@suryaiyer95
Copy link
Copy Markdown
Contributor

@suryaiyer95 suryaiyer95 commented Apr 17, 2026

PINEAPPLE

Summary

Polish the Altimate provider connect flow based on Slack feedback:

  • Default API URL: parseAltimateKey now accepts instance-name::api-key — URL defaults to https://api.myaltimate.com. The 3-part https://api.example.com::instance-name::api-key form still works for custom / self-hosted deployments. Detection is purely positional: 2 parts → no URL, 3+ parts → first segment is the URL (must include http:// or https://).
  • Rename display names:
    • Provider: "Altimate""Altimate AI"
    • Default model: "Altimate AI""Altimate LLM Gateway"
    • Internal IDs (altimate-backend, altimate-default) are left unchanged on purpose — renaming them would invalidate persisted model selections in model.json (favorites / recents) and break any user with model: "altimate-backend/altimate-default" pinned in opencode.json.
  • TUI polish:
    • Input placeholder for the Altimate provider changed from "API key" to "instance-name::api-key" so it matches the expected format.
    • Dialog copy, example, and validation error message updated to reflect the new default-URL form with custom-URL fallback.
  • Docs (docs/docs/getting-started.md, docs/docs/configure/providers.md) and tests updated to match. The auto-selection tip in providers.md now references the display name ("Altimate LLM Gateway") rather than the internal model ID. CHANGELOG.md left alone (historical).
  • Added a JSDoc to parseAltimateKey documenting the two accepted formats.

Test plan

  • bun test test/altimate/datamate.test.ts — 53/53 pass (new coverage for 2-part parsing, whitespace, empty-field rejection, single-part rejection, non-http URL rejection)
  • bun test test/provider/provider.test.ts test/branding/*.test.ts test/skill/release-v0.5.20-adversarial.test.ts — 284/284 pass
  • turbo typecheck — no new errors introduced; pre-existing installation/index.ts errors on main are unrelated
  • Manual TUI smoke: run /connectAltimate AI, enter mycompany::abc123, confirm credentials validate against the default api.myaltimate.com URL
  • Manual TUI smoke: enter https://api.getaltimate.com::mycompany::abc123, confirm the custom-URL path still works

Checklist

  • Tests added/updated
  • Documentation updated
  • CHANGELOG updated — not adding an entry; will bundle with the next release notes.

Review threads (all resolved)

  • Copilot + cubic P3: docs said "select Altimate" — fixed to "select Altimate AI" (commit 12b1a30bc).
  • cubic P1: model ID rename broke backward compatibility — reverted; added a code comment explaining why the internal ID is intentionally preserved (commit ad14dd5b4).
  • Coderabbit: custom-URL example was ambiguous about required scheme — replaced api-url::... with https://api.example.com::... and added explicit scheme requirement (commit ad14dd5b4).
  • Coderabbit pre-merge: missing JSDoc — added to parseAltimateKey (commit 454f9f2dd).

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Simplified Altimate credentials format to instance-name::api-key with automatic default API URL
    • Added support for custom API URLs using api-url::instance-name::api-key
    • Updated Altimate provider branding to "Altimate AI" and model name to "Altimate LLM Gateway"
  • Documentation

    • Updated Altimate configuration instructions to reflect new credential format

… placeholder

- parseAltimateKey now accepts `instance-name::api-key` (URL defaults to
  https://api.myaltimate.com); `api-url::instance-name::api-key` still
  works for custom/self-hosted instances.
- Provider display name: "Altimate" → "Altimate AI".
- Default model display name: "Altimate AI" → "Altimate LLM Gateway".
- TUI input placeholder for altimate-backend changed from "API key" to
  "instance-name::api-key" so it matches the expected format.
- Dialog copy, example, and validation error message updated to reflect
  the new default-URL form with custom-URL fallback.
- Docs (docs/docs/getting-started.md) and tests updated accordingly.

Internal IDs (`altimate-backend`, `altimate-default`) are intentionally
left unchanged to preserve auth-store / config compatibility.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 17, 2026 19:08
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1b288670-8d41-4735-8ad2-7a81788f0167

📥 Commits

Reviewing files that changed from the base of the PR and between 454f9f2 and ad14dd5.

📒 Files selected for processing (3)
  • docs/docs/configure/providers.md
  • docs/docs/getting-started.md
  • packages/opencode/src/provider/provider.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/docs/getting-started.md
  • packages/opencode/src/provider/provider.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/configure/providers.md

📝 Walkthrough

Walkthrough

The PR simplifies the Altimate credential format from a required 3-part structure to an optional 2-part format using a default API URL, while preserving support for custom URLs via a 3-part variant. Provider branding was updated from "Altimate" to "Altimate AI," and the model display name was changed to "Altimate LLM Gateway." All related documentation, tests, and UI components were synchronized accordingly.

Changes

Cohort / File(s) Summary
Documentation
docs/docs/getting-started.md, docs/docs/configure/providers.md
Updated Altimate credential documentation to reflect new 2-part and optional 3-part formats; simplified default instance-name::api-key format with https://api.myaltimate.com as default; updated model selection documentation.
API Client Logic
packages/opencode/src/altimate/api/client.ts
Introduced DEFAULT_ALTIMATE_URL constant; refactored parseAltimateKey to accept both 2-part (instance-name::api-key) and 3-part (api-url::instance-name::api-key) credential formats with conditional URL defaulting.
CLI Dialog UI
packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
Updated TUI dialog input placeholder and validation messaging for altimate-backend provider to match new credential formats; adjusted example and custom URL guidance.
Provider Registry
packages/opencode/src/provider/provider.ts
Updated provider display name from "Altimate" to "Altimate AI" and model name from "Altimate AI" to "Altimate LLM Gateway"; added clarifying comment on backward compatibility.
Test Suite
packages/opencode/test/altimate/datamate.test.ts
Expanded parseAltimateKey test coverage for single-part invalidity, new 2-part format with default URL, whitespace trimming, empty segment validation, and 3-part URL precedence handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • anandgupta42

Poem

🐰 Hop, hop, the credentials align,
Two colons now, not three divine,
A default URL makes life so fine,
Altimate AI shines and intertwine!
Tests and docs, all in a line,

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: default URL handling, renaming of display labels, and placeholder text fixes in the Altimate connect dialog.
Description check ✅ Passed The description includes the required PINEAPPLE marker, comprehensive Summary section explaining all changes, detailed Test Plan with test results and manual smoke test steps, and completed Checklist with appropriate rationale.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/altimate-connect-dialog-polish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Polishes the Altimate provider connect flow by supporting a default Altimate API URL when users enter 2-part credentials, updating provider/model display names, and aligning the TUI and docs with the new credential format.

Changes:

  • Extend parseAltimateKey to accept instance-name::api-key with a default Altimate API URL, while preserving the api-url::instance-name::api-key form.
  • Update provider/model display names for Altimate in the provider registry.
  • Update TUI placeholder/help text and add tests/docs reflecting the new credential entry format.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/opencode/test/altimate/datamate.test.ts Adds test coverage for 2-part Altimate credential parsing and invalid-input handling.
packages/opencode/src/provider/provider.ts Renames Altimate provider/model display names without changing internal IDs.
packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx Updates Altimate connect dialog placeholder, example text, and validation error message for the new format.
packages/opencode/src/altimate/api/client.ts Implements default-URL parsing behavior in parseAltimateKey for 2-part input.
docs/docs/getting-started.md Updates credential format docs and adds guidance for custom API URLs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/docs/getting-started.md Outdated
Drop the `://` heuristic for detecting whether the user supplied an
API URL. Rule is now purely positional:

- split("::").length == 2 → URL omitted → default to
  https://api.myaltimate.com
- length >= 3 → first segment IS the URL; validated as http(s)://

This matches the mental model "if split on :: gives 2, no URL".
It also means a 2-part API key cannot contain `::`; that's an
acceptable trade-off because Altimate keys don't use `::`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/src/provider/provider.ts">

<violation number="1" location="packages/opencode/src/provider/provider.ts:1051">
P3: The provider display name was changed to `"Altimate AI"` here, but the docs at `docs/docs/getting-started.md` line 86 still instruct users to select **Altimate** in `/connect`. Update the docs to say **Altimate AI** so the instructions match the TUI.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/opencode/src/provider/provider.ts
suryaiyer95 and others added 3 commits April 17, 2026 12:17
The display name is already "Altimate LLM Gateway" — the ID should
match instead of staying as the opaque "altimate-default".

Touched:
- packages/opencode/src/provider/provider.ts (model registration +
  default-selection + log message)
- packages/opencode/src/acp/agent.ts (default-selection)
- packages/opencode/test/provider/provider.test.ts (assertions)
- packages/opencode/test/skill/release-v0.5.20-adversarial.test.ts
  (parseModel test fixture)
- docs/docs/configure/providers.md (tip text)

Provider ID `altimate-backend` intentionally left alone — that one is
an auth-storage / credential-file boundary and renaming it has a much
larger blast radius. CHANGELOG.md left alone — historical record.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses review feedback from Copilot and cubic-dev-ai: the
getting-started guide instructed users to select **Altimate** in the
/connect TUI, but the provider display name is now **Altimate AI**.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses Coderabbit pre-merge docstring-coverage check by documenting
the 2-part (default URL) vs 3+ part (custom URL) behavior of
parseAltimateKey.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/docs/getting-started.md`:
- Around line 97-101: Clarify that the custom API URL must include the URL
scheme (http:// or https://) by updating the example and explanatory text:
change the generic example line "api-url::instance-name::api-key" to an explicit
example with a scheme like "https://api.example.com::instance-name::api-key" and
add one short sentence stating "Include the URL scheme (http:// or https://) in
the api-url part; hostname-only values will fail validation." This targets the
example and surrounding text in the getting-started.md snippet so the parser
requirement is explicit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 808dc90a-4fb8-41c3-aab3-c349d4f538f4

📥 Commits

Reviewing files that changed from the base of the PR and between 25e72a2 and 454f9f2.

📒 Files selected for processing (2)
  • docs/docs/getting-started.md
  • packages/opencode/src/altimate/api/client.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/opencode/src/altimate/api/client.ts

Comment thread docs/docs/getting-started.md Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/src/provider/provider.ts">

<violation number="1" location="packages/opencode/src/provider/provider.ts:1025">
P1: Changing the Altimate internal model ID to `altimate-llm-gateway` without an alias breaks backward compatibility for persisted `cfg.model` values that still use `altimate-default`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/opencode/src/provider/provider.ts Outdated
Addresses two review findings:

1. cubic P1 — renaming the internal model ID from `altimate-default` to
   `altimate-llm-gateway` broke backward compatibility. Opencode
   persists selected model IDs to `model.json` (favorites, recents,
   variants) and users can pin `model: altimate-backend/altimate-default`
   in their opencode.json. After the rename those references would
   silently go stale. Keep the ID as `altimate-default`; the polish the
   user actually wanted was the display name, which stays as
   "Altimate LLM Gateway". Added a comment explaining why the ID is
   preserved. Rephrased the auto-selection tip in
   `docs/docs/configure/providers.md` to refer to the display name
   rather than the internal ID.

2. Coderabbit — the custom-URL example in `docs/docs/getting-started.md`
   used `api-url::instance-name::api-key` which is ambiguous; the parser
   requires `http(s)://`. Replaced with a concrete
   `https://api.example.com::...` example and added a sentence stating
   the scheme is required.

Also reverted provider.ts, acp/agent.ts, provider.test.ts, and
release-v0.5.20-adversarial.test.ts to use the original `altimate-default`
ID.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@github-actions github-actions Bot closed this Apr 17, 2026
@anandgupta42 anandgupta42 reopened this Apr 21, 2026
@anandgupta42 anandgupta42 merged commit c3fc44d into main Apr 21, 2026
28 checks passed
@github-actions
Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants